package cc.javaee.bbs.dao.activity;

import cc.javaee.bbs.dao.BaseDao;
import cc.javaee.bbs.model.activity.BankuaiCustomer;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author xdw
 */
@Repository
public class BankuaiCustomerDao extends BaseDao {
    String ns = "kbr_bankuai_customer.";

    public List<BankuaiCustomer> find(BankuaiCustomer bankuaiCustomer) {
        List<BankuaiCustomer> list = this.getSqlSession().selectList(ns + "find", bankuaiCustomer);
        return list;
    }

    public int insert(BankuaiCustomer bankuaiCustomer) {
        return this.getSqlSession().insert(ns + "insert", bankuaiCustomer);
    }

    /**
     * 
     * @param customerId
     * @return
     */
	public BankuaiCustomer getCustomerInfoByCustomerId(String archivalNumber) {
		List<BankuaiCustomer> list = this.getSqlSession().selectList(ns + "getCustomerInfoByArchivalNumber", archivalNumber);
		if(list!=null&&list.size()>0) {
			return list.get(0);
		}
        return null;
	}

}
